package com.resume.crm01.controller;

import com.resume.crm01.model.CourseBook;
import com.resume.crm01.model.PageResult;
import com.resume.crm01.service.CourseBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/coursebook")
public class CourseBookController {

    @Autowired
    private CourseBookService courseBookService;

    @RequestMapping("/list")
    public String index(){
        return "coursebook/list";
    }

    @RequestMapping("/listJson")
    @ResponseBody
    public PageResult<CourseBook> listJson(CourseBook condition, int page, Integer pageSize){
        PageResult<CourseBook> result = courseBookService.findPageResult(condition,page,2);

        return result;
    }

//    @RequestMapping("/list")
//    public String index(){
//        return "coursebook/list";
//    }
//
//    @RequestMapping("/listJson")
//    @ResponseBody
//    public PageResult<CourseBook> listJson(CourseBook condition, int page, int pageSize){
//        PageResult<CourseBook> result = courseBookService.findPageResult(condition,page,pageSize);
//
//        return result;
//    }

//    @RequestMapping("/list")
//    public String index(){
//        return "coursebook/list";
//    }
//
//    @RequestMapping("/listJson")
//    @ResponseBody
//    public PageResult<CourseBook> listJson(CourseBook condition, int page, int limit){
//        PageResult<CourseBook> result = courseBookService.findPageResult(condition,page,limit);
//        return result;
//    }

//    @RequestMapping("/list")
//    public String index(){
//        return "coursebook/list";
//    }
//
//    @RequestMapping("/listJson")
//    @ResponseBody
//    public PageResult<CourseBook> listJson(CourseBook condition, int page, int limit){
//        PageResult<CourseBook> result = courseBookService.findPageResult(condition,page,limit);
//        return result;
//    }

}
